package xin.huangyan.accessibilityapp;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class WeixinDialogActivity extends Activity {
    private TextView comfirm_textview;
    private TextView tipTextView;
    private TextView tipTitle;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_weixin_dialog_activity);
        this.setFinishOnTouchOutside(false);//设置窗口周围触摸不消失
        getWindow().setDimAmount(0.6f);//设置窗口周围透明
        initView();
    }
    private void initView() {
        comfirm_textview = (TextView) this.findViewById(R.id.comfirm_textview);
        tipTextView = (TextView) this.findViewById(R.id.tipTextView);
        tipTitle = (TextView) this.findViewById(R.id.tipTitle);
        comfirm_textview.setClickable(true);
        comfirm_textview.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View paramView) {
                //todo
                finish();
            }
        });

        Intent intent = getIntent();
        if (intent != null) {
            String msg = intent.getStringExtra("msg");
            if (!TextUtils.isEmpty(msg)) {
                if (msg.contains(":")) {
                    String[] msgs = msg.split(":");
                    tipTitle.setText(msgs[0]+"发来的微信消息");
                    tipTextView.setText(msgs[1]);
                }else{
                    tipTextView.setText(msg);
                }
            }
        }
    }
}